// Problem: 
// Contest: 
// URL: 
// Memory Limit: 
// Time Limit: 
// #pragma GCC optimize("Ofast")
// #pragma GCC optimize("unroll-loops")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#include<bits/stdc++.h>
using namespace std;
#define int long long
inline int read(){
	int s=0,w=1;
	char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')w=-1;ch=getchar();}
	while(ch>='0'&&ch<='9') s=s*10+ch-'0',ch=getchar();
	return s*w;
}
int n,k;
vector<int> h,w;
bool f(int x)
{
	int a=0;
	for(int i=0;i<n;i++)
	{
		a+=h[i]/x*w[i]/x;
	}
	return a>=k;
}
signed main()
{
	cin>>n>>k;
	int mn=0x3f3f3f3f;
	h=w=vector<int> (n+1);
	for(int i=0;i<n;i++)
	{
		cin>>h[i]>>w[i];
		mn=min(h[i],mn);
		mn=min(w[i],mn);
	}
	int l=1,r=mn,mx=0;
	while(l<=r)
	{
		int mid=(r-l)/2+l;
		if(f(mid))mx=mid,l=mid+1;
		else r=mid-1;
	}
	cout<<mx;
	return 0;
}
